import serial.tools.list_ports

def get_available_ports():
    """获取可用串口列表"""
    return [port.device for port in serial.tools.list_ports.comports()]

def format_time():
    """格式化当前时间"""
    import time
    return time.strftime("%H:%M:%S")